package extendsindex;

public class Person  {
    //jvm自带继承了Object


    //java中所有的类都会直接或者间接继承于Object
    //封装:对象代表什么,就得封装对应的数据和行为
    //javaBean:(成员变量 成员方法 构造方法)

    private String name;
    private  int age;
    private  String gender;

    //构造方法


    public Person() {
    }

    public Person(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }
}
